package com.whiteseason.springbootlean.model;

import com.fasterxml.jackson.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonPropertyOrder({"content","title"})//自定义输出顺序
public class Article {
    @JsonIgnore//忽略该属性，不对前端输出
    private Long id;
    @JsonProperty("auther")//自定义输出名称
    private String author;
    @JsonInclude(JsonInclude.Include.NON_NULL)//如果该项目为空，则不返回给前端
    private String title;
    private String content;
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")//日期格式化
    private Date createTime;

}
